Imports System
Imports System.Collections
Imports System.Configuration.Install
Imports System.ServiceProcess
Imports System.ComponentModel

Public Class ServiceInstaller
    Inherits System.Configuration.Install.Installer

    Friend WithEvents SQLAD_ServiceProcessInstaller As System.ServiceProcess.ServiceProcessInstaller
    Friend WithEvents SQLAD_ServiceInstaller As System.ServiceProcess.ServiceInstaller

    Public Sub New()
        MyBase.New()

        'This call is required by the Component Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call
        ' Instantiate installers for process and services.
        SQLAD_ServiceProcessInstaller = New ServiceProcessInstaller
        SQLAD_ServiceInstaller = New System.ServiceProcess.ServiceInstaller

        '---The services will run under the system account.
        SQLAD_ServiceProcessInstaller.Account = ServiceAccount.LocalSystem
        'ServiceProcessInstaller1.Password = "xx"
        'ServiceProcessInstaller1.Username = "xx"

        '---The services will be started manually.
        SQLAD_ServiceInstaller.StartType = ServiceStartMode.Automatic

        '---ServiceName must equal those on ServiceBase derived classes.  
        SQLAD_ServiceInstaller.DisplayName = "SQLAutoDocSVC"
        SQLAD_ServiceInstaller.ServiceName = "SQLAutoDocSVC"

        ' Add installers to collection. Order is not important.
        Installers.Add(SQLAD_ServiceInstaller)
        Installers.Add(SQLAD_ServiceProcessInstaller)
    End Sub

    Private Sub SQLAD_ServiceInstaller_AfterInstall(ByVal sender As System.Object, ByVal e As System.Configuration.Install.InstallEventArgs) Handles SQLAD_ServiceInstaller.AfterInstall

    End Sub

    Private Sub SQLAD_ServiceProcessInstaller_AfterInstall(ByVal sender As System.Object, ByVal e As System.Configuration.Install.InstallEventArgs) Handles SQLAD_ServiceProcessInstaller.AfterInstall

    End Sub
End Class

